package com.systemframework.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.systemframework.sys.entity.SysRoleMenu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @author summer
 * @date 2023-03-20 14:47
 */
@Mapper
public interface SysRoleMenuMapper extends BaseMapper<SysRoleMenu> {


    /**
     * 根据角色id查询菜单
     * @param roleId
     * @return
     */
    @Select("select rm.menuId from sys_role_menu rm left join sys_menu m on m.id=rm.menuId where roleId=#{roleId}")
    List<Integer> findSelectedIds(@Param("roleId") Integer roleId);
}
